<?php
include("../functions.php");
include("../libs/smarty.class.php");

$smarty = new Smarty();
$title = "Ogłoszenia.";
$smarty->assign("title",$title);

$announcements = getAnnouncements();

if(isset($_POST['add'])){
    //print_r($_POST);
    $title = $_POST['title'];
    $content = $_POST['content'];
    echo addAnnouncement($title, $content);
}
$smarty->assign("announcements",$announcements);
$smarty->display('announcement.tpl');
?>
